package com.gupao.study.strategy;

import java.util.HashMap;
import java.util.Map;

public class ComputeFacory {
    private static Map<String,ICompute> computes = new HashMap<String,ICompute>();
    static {
        computes.put("+",new AddCompute());
        computes.put("-",new SubCompute());
        computes.put("*",new MulCompute());
        computes.put("/",new DivCompute());
    }

    private ComputeFacory(){

    }

    public static ICompute getCompute(String key){
        return computes.get(key);
    }
}
